package com.tdk.bts.service;

import com.tdk.bts.dao.FilmScreenServiceDao;
import com.tdk.bts.entity.Film;
import com.tdk.bts.entity.FilmScreen;
import com.tdk.bts.util.Request;
import com.tdk.bts.vo.FilmScreenVO;

import java.sql.SQLException;
import java.text.ParseException;
import java.util.List;

public class FilmScreenServiceImp implements FilmScreenService {
    private FilmScreenServiceDao filmScreenServiceDao = new FilmScreenServiceDao();
    @Override
    public List<String> findDaysByFilmId(int filmId) throws SQLException {
        return filmScreenServiceDao.findDaysById(filmId);
    }

    @Override
    public List<FilmScreen> findFilmScreenByDayAndFilmId(String day, int filmId) throws SQLException{
         List<FilmScreen> list = filmScreenServiceDao.findFilmScereenByDay(day, filmId);
         return list;
    }

    @Override
    public List<FilmScreenVO> findScreensByFilmIdAndPageNo(Request request) throws SQLException {
        return filmScreenServiceDao.findFilmScreen(request);
    }

    @Override
    public int findScreensCountsByFilmId(Request request) throws SQLException {
        return filmScreenServiceDao.findScreenCounts(request);
    }

    @Override
    public void deleteScreen(int id) {

    }

    @Override
    public void addScreen(FilmScreen fs) throws SQLException, ParseException {
        filmScreenServiceDao.insertScreen(fs);

    }
}
